package com.tiantianfresh.model.web;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @author FANGAO
 * @date 2021/11/10 - 下午 20:10
 */
public class ServerContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sec) {
        //拿到当前路径
        ServletContext application = sec.getServletContext();
        String path = application.getContextPath();
        application.setAttribute("APP_PATH",path);
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
